package com.yzl.single;

/**
 * @program: design-pattern
 * @description: 单例饿汉模式，如：JDK中的Runtime
 * @author: YaoZhiLi
 * @create: 2021-08-01 21:27
 */
public class SingletonHungry {
    private static SingletonHungry instance=new SingletonHungry();
    private SingletonHungry() {

    }

    public static SingletonHungry getInstance(){
        return instance;
    }

    /**
     * 单例对象的方法
     */
    public void process(){
        System.out.println("方法调用成功");
    }
}